#ifndef PATRICIA_H_
#define PATRICIA_H_

#include <iostream>
#include <string>
#include <cassert>
#include "PatriciaNodo.h"

using namespace std;

class Patricia
{
	public:
	
		//contructores:
		//normal:
		Patricia();
		Patricia( const string& );
		//por copia:
		Patricia( const Patricia& );
		//destructor:
		~Patricia();
	
		bool operator==( const Patricia& ) const;
		bool operator!=( const Patricia& ) const;
		Patricia& operator=( const Patricia& );
		
		void agregar( const string& );
		bool pertenece( const string& ) const;
		void sacar( const string& );
		int cardinal() const;
		
		friend ostream& operator<<( ostream&, const Patricia& );
        
	private:
		int _cardinal;
		PatriciaNodo *_raiz;
		
		int _indice( const string& ) const;
		void _copiar( PatriciaNodo*, PatriciaNodo* );
		void _destruir( PatriciaNodo* );
};

#endif /*PATRICIA_H_*/
